/*
 * @Description: 权限范围布尔值用于表单禁用(生产环境开启，和btnPermission一致)
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2021-09-08 18:25:07
 * @LastEditTime: 2021-09-08 18:44:12
 * @FilePath: \cscec-pms-admin\src\utils\disabledPermission.js
 */
import store from '@/store'
let isProd = process.env.NODE_ENV === 'production'
const disabled = process.env.VUE_APP_disabledBtnAuth === 'disabled'
export default function (key) {
  if (isProd && !disabled) {
    if (store.getters.btnPermission.find(el => el.code === key) !== undefined) {
      return false
    } else {
      return true
    }
  } else {
    return false
  }
}
